<template>
  <div class="goodslist">
    <van-tabs v-model="activeType" @click="onChage">
      <van-tab v-for="(item, index) in title" :key="index" :title="item"></van-tab>
    </van-tabs>
  </div>
</template>
<script>
import Vue from 'vue';
import { Tab, Tabs } from 'vant';
Vue.use(Tab).use(Tabs);
export default {
  name: 'Goodslist',
  data() {
    return {
      activeType: 0,
    }
  },
  props: {
    title: {
      type: Array,
      default() {
        return []
      }
    },
    goodsType: {
      type: Number,
      default: 0
    },
    getGoodsData: {
      type: Array,
      default() {
        return []
      }
    }
  },
  methods: {
    onChage() {
      this.$emit('activeType',this.activeType)
    }
  },
  created() {
    this.activeType = this.goodsType;
    console.log(this.getGoodsData);
  }
}
</script>